<?php

/*
*
* BEGIN content_handler.php
*
*
* Dazzler Custom Content Loader
* @Description: Switches between different content based on the URI. Defaults to content/sitecontent.php which in this particular site loads the Dazzler Template found in templates/main.php
* @Authors: Salman, Wits University
* @Copyright: © Wits University 2011 - All Rights Reserved
* @License: BSD License (http://www.linfo.org/bsdlicense.html)
*
*
* BEGIN CHANGELOG
* Developers working on thee files are REQUIRED to maintain this CHANGELOG.
* Please ensure you follow the Changelog Guidelines: http://code.google.com/p/dazzler/wiki/DazzlerDevelopGuideline?ts=1315476570&updated=DazzlerDevelopGuideline
* !==================================================================================================================================================================
*
* VERSION 1.0.0
*	+ File Created, Salman, 8 September 2011
*
* ==================================================================================================================================================================!
* END CHANGELOG
*/


/*******************************************************************************************************************************************************************
*
* BEGIN Direct Call Check
*
/******************************************************************************************************************************************************************/
global $doNotCallThisScriptDirectly;
if ($doNotCallThisScriptDirectly != 1)
{
	/* Read the ini language file */
	$ini_lang_array = array();
	$clientlang = explode(",", strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']));
	$lang_ini_array = (file_exists("lang/" . trim($clientlang[0]) . ".ini")) ? parse_ini_file("lang/" . trim($clientlang[0]) . ".ini", true) : parse_ini_file("lang/en.ini", true);
	die ($lang_ini_array['ERRORS']['doNotCallThisScriptDirectly']);
}
/*******************************************************************************************************************************************************************
*
* END Direct Call Check
*
/******************************************************************************************************************************************************************/



/*******************************************************************************************************************************************************************
* BEGIN Parse the REQUEST URI to extract the calls, pages IDs, etc
/******************************************************************************************************************************************************************/

$uri_array = explode("/", $_SERVER['REQUEST_URI']);
echo $uri_array[2];
/* Based on the URI, load different content heandlers */
switch ($uri_array[2])
{

	default:
		include "main.php";
	break;
}
/*******************************************************************************************************************************************************************
* END Parse the REQUEST URI to extract the calls, pages IDs, etc
/******************************************************************************************************************************************************************/

/*
*
* END content_handler.php
*
*/
?>